package com.jrzh.mvc.search.sys;

import org.apache.commons.lang.StringUtils;
import com.jrzh.framework.searchutils.Criteria;
import com.jrzh.framework.searchutils.Restrictions;
import com.jrzh.framework.base.search.BaseSearch;

public class ManegeInfoSearch extends BaseSearch{
	private static final long serialVersionUID = 1L;
	
    /**
     * Equal 系统编号
     */
    private String equalSysCode;
    
    /**
     * Like 系统编号
     */
    private String likeSysCode;
    
     /**
     * In 系统编号 英文逗号分隔
     */
    private String inSysCodes;
    
    /**
     * Equal 系统使用用户
     */
    private String equalSysOwner;
    
    /**
     * Like 系统使用用户
     */
    private String likeSysOwner;
    
     /**
     * In 系统使用用户 英文逗号分隔
     */
    private String inSysOwners;
    
    /**
     * Equal 系统名称
     */
    private String equalSysName;
    
    /**
     * Like 系统名称
     */
    private String likeSysName;
    
     /**
     * In 系统名称 英文逗号分隔
     */
    private String inSysNames;
    

    public void setEqualSysCode(String equalSysCode) {
        this.equalSysCode = equalSysCode;
    }
    
    public String getEqualSysCode() {
        return this.equalSysCode;
    }
    
    public void setLikeSysCode(String likeSysCode) {
        this.likeSysCode = likeSysCode;
    }
    
    public String getLikeSysCode() {
        return this.likeSysCode;
    }
    
    public void setInSysCodes(String inSysCodes) {
        this.inSysCodes = inSysCodes;
    }
    
    public String getInSysCodes() {
        return this.inSysCodes;
    }
    public void setEqualSysOwner(String equalSysOwner) {
        this.equalSysOwner = equalSysOwner;
    }
    
    public String getEqualSysOwner() {
        return this.equalSysOwner;
    }
    
    public void setLikeSysOwner(String likeSysOwner) {
        this.likeSysOwner = likeSysOwner;
    }
    
    public String getLikeSysOwner() {
        return this.likeSysOwner;
    }
    
    public void setInSysOwners(String inSysOwners) {
        this.inSysOwners = inSysOwners;
    }
    
    public String getInSysOwners() {
        return this.inSysOwners;
    }
    public void setEqualSysName(String equalSysName) {
        this.equalSysName = equalSysName;
    }
    
    public String getEqualSysName() {
        return this.equalSysName;
    }
    
    public void setLikeSysName(String likeSysName) {
        this.likeSysName = likeSysName;
    }
    
    public String getLikeSysName() {
        return this.likeSysName;
    }
    
    public void setInSysNames(String inSysNames) {
        this.inSysNames = inSysNames;
    }
    
    public String getInSysNames() {
        return this.inSysNames;
    }

	@Override
	public void setCriterias(Criteria<?> criterias) {
	    if(StringUtils.isNotBlank(equalSysCode)){
			criterias.add(Restrictions.eq("sysCode", equalSysCode));
		}
	    if(StringUtils.isNotBlank(likeSysCode)){
			criterias.add(Restrictions.allLike("sysCode", likeSysCode));
		}
		 if(StringUtils.isNotBlank(inSysCodes)){
			criterias.add(Restrictions.in("sysCode", StringUtils.split(inSysCodes, ",")));
		}
	    if(StringUtils.isNotBlank(equalSysOwner)){
			criterias.add(Restrictions.eq("sysOwner", equalSysOwner));
		}
	    if(StringUtils.isNotBlank(likeSysOwner)){
			criterias.add(Restrictions.allLike("sysOwner", likeSysOwner));
		}
		 if(StringUtils.isNotBlank(inSysOwners)){
			criterias.add(Restrictions.in("sysOwner", StringUtils.split(inSysOwners, ",")));
		}
	    if(StringUtils.isNotBlank(equalSysName)){
			criterias.add(Restrictions.eq("sysName", equalSysName));
		}
	    if(StringUtils.isNotBlank(likeSysName)){
			criterias.add(Restrictions.allLike("sysName", likeSysName));
		}
		 if(StringUtils.isNotBlank(inSysNames)){
			criterias.add(Restrictions.in("sysName", StringUtils.split(inSysNames, ",")));
		}
	}
}